<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>派工单审核</title>
    <!-- Google Font: Source Sans Pro -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="../dist/css/adminlte.min.css">
    <!-- overlayScrollbars -->
    <link rel="stylesheet" href="../plugins/overlayScrollbars/css/OverlayScrollbars.min.css">
</head>
<body onload="dispatchordequeryr()">
<link rel="stylesheet"  href="../css/bootstrap.min.css">
<link rel="stylesheet"  href="../css/bootstrap-table.min.css">
<script src="../js/jquery.min.js" ></script>
<script src="../js/bootstrap.bundle.min.js" ></script>
<script src="../js/bootstrap.min.js"  ></script>
<script src="../js/bootstrap-table.min.js"  ></script>
<script src="../js/bootstrap-table-zh-CN.min.js"></script>
<script src="../js/index.js"></script>

<table id="tab">

</table>
<a onclick="queryerview(1234)">查看</a>
<div class="modal" tabindex="-1" role="dialog" id="exampleModal">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">生产派工单</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <p>
                <div class="row">
                    <div class="col">
                        派工单编号：<input class="input-group" readonly id="id">
                    </div>
                    <div class="col">
                        产品编号：<input class="input-group" readonly id="cpid">
                    </div>
                </div>
                <div class="row">
                    <div class="col">
                        数量：<input class="input-group" readonly id="num">
                    </div>
                    <div class="col">
                        产品名：<input class="input-group" readonly id="cpname">
                    </div>
                </div>
                <div class="row">
                    <div class="col">
                        工时总成本：<input class="input-group" readonly id="workingtotal">
                    </div>
                    <div class="col">
                        物料总成本：<input class="input-group" readonly id="material">
                    </div>
                </div>
                <div class="row">
                    <div class="col">
                        登记人：<input class="input-group" readonly id="register">
                    </div>
                    <div class="col">
                        登记时间：<input class="input-group" readonly id="registerTime">
                    </div>
                </div>
                <div class="row">
                    <div class="col">
                        审核人：<input class="input-group" readonly id="checker">
                    </div>
                    <div class="col">
                        审核时间：<input class="input-group" readonly id="checktime">
                    </div>
                </div>
                派工单定制人：<input class="input-group" readonly id="customized">
                <table id="mytables" class="table">
                    <tr id="MyTr">
                        <th>序号</th>
                        <th>工序名</th>
                        <th>工序编号</th>
                        <th>工时</th>
                        <th>工时成本</th>
                        <th>物料成本</th>
                        <th>审核</th>
                    </tr>
                </table>
                <div class="row">
                    <textarea id="remark">

                    </textarea>
                    </p>
                </div>
                <input type="submit" class="btn btn-outline-success" value="通过" onclick="ck('S001-1')">
                <input type="submit" class="btn btn-outline-warning" value="未通过" onclick="ck('S001-2')">

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>
<div class="modal" tabindex="-1" role="dialog" id="mybigdiv">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Modal title</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <table id="mytab">

                </table>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                <button type="button" class="btn btn-primary">Save changes</button>
            </div>
        </div>
    </div>
</div>
<script>
    function ck(sta){
        $.post("../scpg/updatemp",{"checkTime":sta},function (date) {

        },"json")
    }
    f1()
    function f1() {
        var sum=0;
        var i=$(" a").length ;
        var total=0;
        console.log(i)
        for (var j=0;j<i-1;j++){
          sum=sum+parseInt($("#mytables a:eq("+j+")").parent().prev().html())
            total=total+parseInt($("#mytables a:eq("+j+")").parent().prev().prev().html())
        }
        $("#material").val(sum)
        console.log(sum)
    }
</script>
</body>
</html>